/**
 * Created by 15670 on 2016/10/31.
 */
(function () {
    var _ajax = $.ajax;
    $.ajax = function (opt) {
        var language = localStorage.getItem("language");
        if (language == 1) {
            language = "zh_CN";
        } else if (language == 2) {
            language = "in_ID";
        } else if (language == 3) {
            language = "vi_VN";
        } else if (language == 4) {
            language = "en_EN";
        } else if (language == 5) {
            language = "ru_RU";
        }
        if (!language) {//首次默认中文
            language = "zh_CN";
        }
        if (opt.url.indexOf("?") > -1) {
            opt.url += '&bl=' + language;
        } else {
            opt.url += '?bl=' + language;
        }
        return _ajax(opt);
    };
})();
